import Vue from 'vue';
const pm10 = Vue.directive('pm10', {
  bind:function(el){
    var jcolor;
    if(el.innerText<50){
      jcolor='#43CE17'
    }else if(el.innerText<150){
      jcolor='#FFAA00'
    }else if(el.innerText>150){
      jcolor='#D20040'
    }
    el.style.background=jcolor
  },
  updated: function (el) {
    console.log(el)
    var jcolor1;
    if(el.innerText<50){
      jcolor1='#43CE17'
    }else if(el.innerText<150){
      jcolor1='#FFAA00'
    }else if(el.innerText>150){
      jcolor1='#D20040'
    }
    el.style.background=jcolor1
  }
})
export default pm10;
